package com.atguigu.srb.core.service;

import com.atguigu.srb.core.pojo.entity.BorrowInfo;
import com.atguigu.srb.core.pojo.vo.BorrowInfoApprovalVO;
import com.atguigu.srb.core.pojo.vo.BorrowerApprovalVO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 借款信息表 服务类
 * </p>
 *
 * @author gcq
 * @since 2021-04-11
 */
public interface BorrowInfoService extends IService<BorrowInfo> {

    /**
     * 获取借款额度
     * @param userId 用户Id
     * @return 借款金额
     */
    BigDecimal getBorrowAmount(Long userId);

    /**
     * 保存借款信息
     * @param userId 用户Id
     * @param borrowInfo 借款信息
     */
    void saveBorrowInfo(Long userId, BorrowInfo borrowInfo);

    /**
     * 获取借款申请审批状态
     * @param userId 用户Id
     * @return
     */
    Integer getBorrowerStatus(Long userId);

    /**
     * 查询借款人信息
     * @return
     */
    List<BorrowInfo> selectList();

    /**
     * 获取借款详细信息
     * @param id 借款Id
     * @return
     */
    Map<String, Object> getBorrowInfoDetailById(Long id);

    /**
     * 审批借款信息
     * @param borrowInfoApprovalVO 审批Vo
     */
    void approval(BorrowInfoApprovalVO borrowInfoApprovalVO);
}
